<?
/* tento soubor je urcen pro include a volani funkci jako pridej forum apd */

define('INCLUDE_PATH', 'include/');
		include INCLUDE_PATH . 'common.inc.php';
		include INCLUDE_PATH . 'primat.interface.php';
/*
 @cat_name  - jmeno fora
 @description - popis fora
 @parent - jaky je otec fora
 @prava - prava pro forum
 @return adresu na forum
 */
function SetCreateForum($cat_name, $description, $parent=0, $prava=32831) {		

		$unix_name = unixify($cat_name);
		
		$forums = new forums;

		$f = $forums->add_category($cat_name, $description, $unix_name);
		$forums->create_as_forum($f, $parent);

		$permissions = new permission('forums', $f);
		$permissions->updatedef('forums', $f, $cat_name . ' Permissions', $prava);
		return  $f;
}
						
 
// ukazka jak se pridava nove forum 
/*
$forum_id = SetCreateForum("kraag forum", "nejlepsi forum na svete");
echo forums::furl('viewforum',$forum_id); //adresa fora
/**/




function geturl($url)
{
	$ch = curl_init();
	$timeout = 10;
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
	$html = curl_exec($ch);
	curl_close($ch);
	return $html;
}

echo geturl('http://localhost/aretin/');
//
//$fp = fsockopen("127.0.0.1/aterr/forum", 80, $errno, $errstr, 30);
//if (!$fp) {
//    echo "$errstr ($errno)<br />\n";
//} else {
//    $out = "GET / HTTP/1.1\r\n";
//    $out .= "Host: www.example.com\r\n";
//    $out .= "Connection: Close\r\n\r\n";
//
//    fwrite($fp, $out);
//    while (!feof($fp)) {
//        echo fgets($fp, 128);
//    }
//    fclose($fp);
//}
?>